﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>参数配置</title>

    <link href="../css/site.css" rel="stylesheet" />
    <style type="text/css">
        .divContent {
            width: 1000px;
            height: 800px;
            /*margin-left: auto;
            margin-right:auto;*/
            position: absolute;
            right: 0;
            left: 0;
            top: 0;
            bottom: 0;
            margin: auto;
        }

        #nav {
            width: 1000px; /* 控制导航总宽度 */
            height: 30px;
            background-color: red;
        }

            /* 取消列表样式，内外补间为零 */
            #nav ul {
                list-style: none;
                margin: 0;
                padding: 0;
            }

            /* 横排：控制导航高度 ，使用float 指定每个li的宽度和高度 */
            #nav li {
                float: left;
                width: 16.66666%;
                height: 30px;
                line-height: 30px; /* 文字垂直居中 指定行高为li高度 自动垂直居中 */
                display: block;
                text-decoration: none; /* 取消a标签下划线 */
                text-align: center; /* 文字水平居中显示 */
                background-color: darkgrey;
                color: forestgreen;
                font-size: 25px;
                -webkit-user-select: none;
                -moz-user-select: none;
                -ms-user-select: none;
                user-select: none;
                cursor: pointer;
            }

        /*#nav li:hover {
                    background-color: wheat;
                    color: #000;
                }*/
    </style>

    <script src="../lib/jquery/dist/jquery.js"></script>
    <script src="../js/config.js"></script>
    <script type="text/javascript">
        function getNavEleIdById(id) {
            var navEleId;
            switch (id) {
                case 1:
                    navEleId = '#liProjectManagement';
                    break;
                case 2:
                    navEleId = '#liParaGroupManagement';
                    break;
                case 3:
                    navEleId = '#liParaManagement';
                    break;
                case 4:
                    navEleId = '#liModuleManagement';
                    break;
                case 5:
                    navEleId = '#liParaValueSetting';
                    break;
                case 6:
                    navEleId = '#liParaHistoryValueManagement';
                    break;
                default:
                    throw "未知id:" + id;
            }

            return navEleId;
        }

        function selectedFunc(id) {
            if (id == 1) {
                window.location.href = "/htmls/projectManagement.html";
                return;
            }

            var lastSelectedId = Number(sessionStorage.getItem("lastSelectedId"));
            if (lastSelectedId == id) {
                return;
            }

            var url;
            switch (id) {
                case 2:
                    url = "/htmls/paraGroupManagement.html";
                    break;
                case 3:
                    url = "/htmls/paraManagement.html";
                    break;
                case 4:
                    url = "/htmls/moduleManagement.html";
                    break;
                case 5:
                    url = "/htmls/paraValueSetting.html";
                    break;
                case 6:
                    url = "/htmls/paraHistoryValueManagement.html";
                    break;
                default:
                    return;
            }

            var lastSelectedNavId = sessionStorage.getItem("lastSelectedNavId");
            if (lastSelectedNavId != null && lastSelectedNavId != undefined) {
                $(lastSelectedNavId).css("background-color", "darkgrey");
            }

            var currentSelectedNavId = getNavEleIdById(id);
            sessionStorage.setItem("lastSelectedNavId", currentSelectedNavId);
            sessionStorage.setItem(constDefine.paraConfigSelectedIdKey, id);
            $(currentSelectedNavId).css("background-color", "wheat");
            $("#iframe").attr("src", url);
        }

        function SetDefaultSelected() {
            var id = Number(sessionStorage.getItem(constDefine.paraConfigSelectedIdKey));
            if (id < 0) {
                id = 2;
            }

            selectedFunc(id);
        }

        $(document).ready(function () {
            pageLoginValidate();

            SetDefaultSelected();
        });
    </script>
</head>
<body>
    <div class="divContent contentBackgroundColor">
        <div id="nav">
            <ul>
                <li id="liProjectManagement" onclick="selectedFunc(1)">返回</li>
                <li id="liParaGroupManagement" onclick="selectedFunc(2)">参数分组</li>
                <li id="liParaManagement" onclick="selectedFunc(3)">参数管理</li>
                <li id="liModuleManagement" onclick="selectedFunc(4)">模块参数</li>
                <li id="liParaValueSetting" onclick="selectedFunc(5)">参数设置</li>
                <li id="liParaHistoryValueManagement" onclick="selectedFunc(6)">历史参数</li>
            </ul>
        </div>

        <iframe id="iframe" src="" width="996" height="766"></iframe>
    </div>
</body>
</html>
